package com.qs.utils;

/**
 * ClassName: LoginTypeUtil
 * Package: com.qs.utils
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2024/1/6 - 20:40
 * @Version: v1.0
 */

import javax.servlet.http.HttpServletRequest;

/**
 * 判断登录方式工具类
 */
public class LoginTypeUtil {

    public static String getLoginType(HttpServletRequest request){
        String userAgent = request.getHeader("User-Agent");
        if (userAgent != null && (userAgent.contains("Windows") || userAgent.contains("Macintosh"))) {
            return "PC";
        } else if (userAgent != null && userAgent.contains("Mobile")) {
            return "MOBILE";
        } else {
            return "UNKNOWN";
        }
    }
}
